package com.ruoyi.patrol.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.patrol.mapper.PatrolPathMapper;
import com.ruoyi.patrol.domain.PatrolPath;
import com.ruoyi.patrol.service.IPatrolPathService;

/**
 * 巡查路线Service业务层处理
 * 
 * @author yepanpan
 * @date 2025-05-08
 */
@Service
public class PatrolPathServiceImpl implements IPatrolPathService 
{
    private static final Logger log = LoggerFactory.getLogger(PatrolPathServiceImpl.class);

    @Autowired
    private PatrolPathMapper patrolPathMapper;

    /**
     * 查询巡查路线
     * 
     * @param id 巡查路线主键
     * @return 巡查路线
     */
    @Override
    public PatrolPath selectPatrolPathById(Long id)
    {
        return patrolPathMapper.selectPatrolPathById(id);
    }

    /**
     * 查询巡查路线列表
     * 
     * @param patrolPath 巡查路线
     * @return 巡查路线
     */
    @Override
    public List<PatrolPath> selectPatrolPathList(PatrolPath patrolPath)
    {
        return patrolPathMapper.selectPatrolPathList(patrolPath);
    }

    /**
     * 新增巡查路线
     * 
     * @param patrolPath 巡查路线
     * @return 结果
     */
    @Override
    public int insertPatrolPath(PatrolPath patrolPath)
    {
        patrolPath.setCreateTime(DateUtils.getNowDate());
        return patrolPathMapper.insertPatrolPath(patrolPath);
    }

    /**
     * 修改巡查路线
     * 
     * @param patrolPath 巡查路线
     * @return 结果
     */
    @Override
    public int updatePatrolPath(PatrolPath patrolPath)
    {
        patrolPath.setUpdateTime(DateUtils.getNowDate());
        return patrolPathMapper.updatePatrolPath(patrolPath);
    }

    /**
     * 批量删除巡查路线
     * 
     * @param ids 需要删除的巡查路线主键
     * @return 结果
     */
    @Override
    public int deletePatrolPathByIds(Long[] ids)
    {
        return patrolPathMapper.deletePatrolPathByIds(ids);
    }

    /**
     * 删除巡查路线信息
     * 
     * @param id 巡查路线主键
     * @return 结果
     */
    @Override
    public int deletePatrolPathById(Long id)
    {
        return patrolPathMapper.deletePatrolPathById(id);
    }


}
